package com.bluemsun.naturallanguageprocessing.controller;

import com.bluemsun.naturallanguageprocessing.common.ServerResponse;
import com.bluemsun.naturallanguageprocessing.entity.Notice;
import com.bluemsun.naturallanguageprocessing.service.impl.NoticeServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author ：hj
 * @date ：Created in 2021/4/29 19:15
 * @description：公告
 * @modified By：
 * @version: $
 */
@RestController
@RequestMapping("/notice/")
public class NoticeController {
   @Autowired
    NoticeServiceImpl noticeService;

   @GetMapping("get")
   @ResponseBody
    public ServerResponse getList(@RequestParam("pageSize") Integer pageSize,@RequestParam("pageNum") Integer pageNum){
       return noticeService.getList(pageSize,pageNum);
   }

   @PostMapping("update")
   @ResponseBody
   public ServerResponse update(@RequestBody Notice notice){
       return noticeService.updateList(notice);
   }

   @PostMapping("insert")
    @ResponseBody
    public ServerResponse insert(@RequestBody Notice notice){
       return  noticeService.insertNotice(notice);
   }
}
